﻿using AnyLink.Domain.Enums;
using Newtonsoft.Json;
using SqlSugar;

namespace AnyLink.Domain.Entities.System
{
    /// <summary>
    /// 菜单权限表
    /// </summary>
    [SugarTable("sys_menu", TableDescription = "菜单权限表", IsDisabledUpdateAll = true)]
    public class SysMenu : BaseAuditedEntity<long>
    {
        /// <summary>
        /// 菜单ID
        /// </summary>
        [SugarColumn(ColumnName = "menu_id", IsPrimaryKey = true, ColumnDescription = "菜单ID")]
        [JsonProperty(propertyName: "menuId")]
        public override long Id { get; set; }

        /// <summary>
        /// 菜单名称
        /// </summary>
        [SugarColumn(ColumnName = "menu_name", ColumnDataType = "VARCHAR(50)", ColumnDescription = "菜单名称", IsNullable = true)]
        public string MenuName { get; set; }

        /// <summary>
        /// 父菜单ID
        /// </summary>
        [SugarColumn(ColumnName = "parent_id", ColumnDescription = "父菜单ID", IsNullable = true)]
        public long ParentId { get; set; }

        /// <summary>
        /// 显示顺序
        /// </summary>
        [SugarColumn(ColumnName = "order_num", ColumnDescription = "显示顺序", IsNullable = true)]
        public int OrderNum { get; set; }

        /// <summary>
        /// 请求地址
        /// </summary>
        [SugarColumn(ColumnName = "url", ColumnDataType = "VARCHAR(200)", ColumnDescription = "请求地址", IsNullable = true)]
        public string Url { get; set; }

        /// <summary>
        /// 打开方式（menuItem页签 menuBlank新窗口）
        /// </summary>
        [SugarColumn(ColumnName = "target", ColumnDataType = "VARCHAR(20)", ColumnDescription = "打开方式（menuItem页签 menuBlank新窗口）", IsNullable = true)]
        public string Target { get; set; }

        /// <summary>
        /// 菜单类型（M目录 C菜单 F按钮）
        /// </summary>
        [SugarColumn(ColumnName = "menu_type", ColumnDescription = "菜单类型（M目录 C菜单 F按钮）", IsNullable = true)]
        public string MenuType { get; set; }

        /// <summary>
        /// 菜单状态（0显示 1隐藏）
        /// </summary>
        [SugarColumn(ColumnName = "visible", ColumnDescription = "菜单状态（0显示 1隐藏）", IsNullable = true)]
        public StatusEnum Visible { get; set; }

        /// <summary>
        /// 是否刷新（0刷新 1不刷新）
        /// </summary>
        [SugarColumn(ColumnName = "is_refresh", ColumnDescription = "是否刷新（0刷新 1不刷新）", IsNullable = true)]
        public IsRefreshEnum IsRefresh { get; set; }

        /// <summary>
        /// 权限标识
        /// </summary>
        [SugarColumn(ColumnName = "perms", ColumnDataType = "VARCHAR(100)", ColumnDescription = "权限标识", IsNullable = true)]
        public string Perms { get; set; }

        /// <summary>
        /// 菜单图标
        /// </summary>
        [SugarColumn(ColumnName = "icon", ColumnDataType = "VARCHAR(100)", ColumnDescription = "菜单图标", IsNullable = true)]
        public string Icon { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        [SugarColumn(ColumnName = "remark", ColumnDataType = "VARCHAR(500)", ColumnDescription = "备注", IsNullable = true)]
        public string Remark { get; set; }
    }
}